home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Copyright (C) 1997-1999 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Jan 20, 2000
- //
- // Author: Kevin Smith
- //
- // Description:
- // Script to register UI action with clip editor
- // within it.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
-
-
- ////////////////////////////////////////////////////////////////////////
- //
- // Description:
- // Action called when <backspace> key is pressed
- //
- //
- ////////////////////////////////////////////////////////////////////////
- global proc
- clipEditorDeleteCmd( string $editor )
- {
- doRemoveClipArgList 1 { $editor, "0" };
- }
-
- ////////////////////////////////////////////////////////////////////////
- //
- // Description:
- // Action called when clip is dropped in TraX
- //
- //
- ////////////////////////////////////////////////////////////////////////
- global proc
- clipDropCmd( string $editor, string $clip, string $character, string $track,
- string $startTime )
- {
- string $cmd;
-
- int $isPose = `getAttr ($clip+".pose")`;
-
- // We need to copy and paste if the clip is not already mapped to this
- // character. But if it is already on the character, we can just
- // instance it.
- //
- int $copyPasteNeeded = 1;
- string $clipChars[] = `clip -q -ch $clip`;
- string $clipChar;
- for ($clipChar in $clipChars) {
- if ($clipChar == $character) {
- $copyPasteNeeded = 0;
- break;
- }
- }
-
- float $ftrack = $track;
-
- if ($copyPasteNeeded) {
- // copy and paste by node name by default
- //
- string $mapMethod = "byNodeName";
- string $map;
- if (size($clipChars) == 1) {
- $map = `characterMap -q $clipChars[0] $character`;
- if (size($map)) {
- // if a character map exists, use the character map
- //
- $mapMethod = "byCharacterMap";
- }
- }
- $cmd = ("clip -copy "+$clip+"; clip -paste -sc 1 -absolute 1 -s "+$startTime+" -mm \""+$mapMethod+"\" "+$character);
- } else {
- for ($clipChar in $clipChars) {
- string $scheduler = `character -q -sc $clipChar`;
- $cmd += ("clipSchedule -instance "+$clip+" -start "+$startTime);
- if ($clipChar == $character) {
- $cmd += (" -track "+$ftrack);
- }
- $cmd += (" "+$scheduler+";");
- }
- }
- evalEcho($cmd);
- }
-
- //
- // Register UI actions with the clip editor. These are mel proc commands
- // that get called when UI events happen in the clip editor.
- //
- global proc
- clipEditorRegisterActions ( string $editor )
- {
- // Delete Key
- clipEditor -e
- -deleteCmd clipEditorDeleteCmd
- $editor;
- // Node drop on track
- clipEditor -e
- -clipDropCmd clipDropCmd
- $editor;
- }
-